package com.zhuss.opus.db.dao.ext;

import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.zhuss.bean.bo.SearchKeyWordBo;
import com.zhuss.bean.vo.opus.invit.DetailInvitTopicVo;
import com.zhuss.opus.db.dao.gen.InvitTopicMapper;
import com.zhuss.opus.db.entity.InvitTopic;

@Mapper
public interface InvitTopicDao extends InvitTopicMapper {
	
	void create(InvitTopic record);
	
	int delete(InvitTopic record);
	
	int deleteByParent(InvitTopic record);
	
	void deleteBatch(@Param("invitTopicIdList") List<Long> invitTopicIdList, @Param("deleted") Integer deleted, @Param("modifierId") Long modifierId,
			@Param("modifier") String modifier, @Param("modifyTime") Date modifyTime);
	
	void deleteByParentBatch(@Param("invitTopicIdList") List<Long> invitTopicIdList, @Param("deleted") Integer deleted, @Param("modifierId") Long modifierId,
			@Param("modifier") String modifier, @Param("modifyTime") Date modifyTime);
	
	Integer countNoReadNum(@Param("toUserId") Long toUserId, @Param("isRead") Integer isRead);
	
	void updateAlreadyRead(@Param("toUserId") Long toUserId, @Param("isRead") Integer isRead);
	
	List<DetailInvitTopicVo> listAppend(@Param("toUserId") Long toUserId, @Param("creatorId") Long creatorId, @Param("start") Integer start, @Param("length") Integer length);

	Integer countListAppend(@Param("toUserId") Long toUserId, @Param("creatorId") Long creatorId);
	
	List<InvitTopic> listAll(@Param("area") Integer area, @Param("invitId") Long invitId);
	
	DetailInvitTopicVo detail(@Param("invitTopicId") Long invitTopicId);
	
	List<Long> listSon(@Param("invitTopicIdList") List<Long> invitTopicIdList);

	List<DetailInvitTopicVo> listTopic(@Param("invitId") Long invitId, @Param("parent") Long parent);
	
	List<Long> keyWord(SearchKeyWordBo bo);
    
}